﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace RBS.Web.Hotel.Models.Order
{
    public class OrderViewModel
    {
        public OrderViewModel()
        {
            this.Number = RBS.Common.Utils.GetOrderNumber();
        } 
        /// <summary>
        /// 订单编号
        /// </summary>
        public string Number { get; set; }
        /// <summary>
        /// 订单信息
        /// </summary>
        public RBS.Core.Model.D_Order OrderModel { get; set; }
        /// <summary>
        /// 菜单信息
        /// </summary>
        public IList<RBS.Core.Model.V_OrderDetails> OrderDetailsModel { get; set; }
        /// <summary>
        /// 座位信息
        /// </summary>
        public string SeateName { get; set; }
        /// <summary>
        /// 酒店优惠券信息
        /// </summary>
        public IList<RBS.Core.Model.P_Advertis_Payment> HotelDeed { get; set; } 
        /// <summary>
        /// 食客信息
        /// </summary>
        public RBS.Core.Model.U_User User { get; set; }
        /// <summary>
        /// 食客积分
        /// </summary>
        public int UserIntegration { get; set; }
        /// <summary>
        /// 食客优惠券
        /// </summary>
        public IList<RBS.Core.Model.P_Advertis_Payment> UserDeed { get; set; }  
        /// <summary>
        /// 结帐信息
        /// </summary>
        public RBS.Core.Model.D_Settlement Seetlement { get; set; } 

        //用户优惠
        public IList<RBS.Core.Model.P_Order_User> OrderUser { get; set; }  
   
    }

    /*
     
       model.Number = RBS.Common.Utils.GetOrderNumber();
            model.OrderModel = new RBS.Core.BLL.D_Order().GetModel(orderid); 
            model.OrderDetailsModel = new RBS.Core.BLL.D_Order_Details().GetModelList("OrderId=" + orderid); 
            model.OrderModel.OrderAmount = model.OrderDetailsModel.Sum(c => c.Num*c.Price);  
            if (model.OrderModel.U_Id>0){
                model.User = new RBS.Core.BLL.U_User().GetModelByCache(model.OrderModel.U_Id).U_Name;
                model.UserIntegration = new RBS.Core.BLL.U_User_Integration().GetIntegralCount(model.OrderModel.U_Id);
            }
            model.SeateName = new RBS.Core.BLL.Hotel.H_Hotel_Seat().GetModelByCache(Convert.ToInt32(model.OrderModel.DineTable)).Name;
            model.Seetlement=new D_Settlement();
     */
}